class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: E = None
        self.u: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: F = None
        self.r: B = None
        self.w: D = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: B = None
        self.p: F = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

g = A("g")
k = B("k")
j = C("j")
n = D("n")
a = E("a")
b = F("b")
f = B("f")
l = F("l")
m = D("m")

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: E = None
        self.u: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: F = None
        self.r: B = None
        self.w: D = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: B = None
        self.p: F = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

g = A("g")
k = B("k")
j = C("j")
n = D("n")
a = E("a")
b = F("b")
f = B("f")
l = F("l")
m = D("m")

g.t = m
g.p = k
k.x = a
k.s = a
k.u = f
j.z = k
j.y = b
j.r = f
j.w = n
j.u = g
n.t = m
n.s = f
n.p = b
n.w = a
a.y = b
b.z = j
b.q = a
f.x = a
f.s = a
f.u = k
l.z = j
l.q = a
m.t = n
m.s = k
m.p = b
m.w = a
assert j.r.u.x.y.txt == "b"