class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: C = None
        self.p: D = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: E = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: A = None
        self.r: E = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.t: A = None
        self.txt = txt

g = A("g")
a = B("a")
b = C("b")
d = D("d")
l = E("l")
m = F("m")
k = B("k")
h = E("h")

g.w = k
g.x = a
g.p = b
a.y = g
a.x = b
a.p = d
a.q = d
b.t = d
b.z = l
b.s = m
d.v = b
d.w = a
l.s = m
l.w = g
l.r = h
l.t = b
m.u = g
m.t = g
m.r = d
k.y = g
k.x = b
k.p = d
k.q = d
h.s = m
h.w = g
h.r = l
h.t = b
assert h.w.x.x.t.w.y.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: C = None
        self.p: D = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: E = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: A = None
        self.r: E = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.t: A = None
        self.txt = txt

g = A("g")
a = B("a")
b = C("b")
d = D("d")
l = E("l")
m = F("m")
k = B("k")
h = E("h")

g.w = k
g.x = a
g.p = b
a.y = g
a.x = b
a.p = d
a.q = d
b.t = d
b.z = l
b.s = m
d.v = b
d.w = a
l.s = m
l.w = g
l.r = h
l.t = b
m.u = g
m.t = g
m.r = d
k.y = g
k.x = b
k.p = d
k.q = d
h.s = m
h.w = g
h.r = l
h.t = b
assert h.w.x.x.t.w.y.x.y.txt == "g"