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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: D = None
        self.q: A = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.o: F = None
        self.v: C = None
        self.t: C = None
        self.txt = txt

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

m = A("m")
l = B("l")
j = C("j")
n = D("n")
f = E("f")
c = F("c")
h = D("h")

m.s = j
m.x = c
m.r = f
l.o = c
l.r = n
j.r = m
j.q = m
j.o = h
j.t = h
n.w = l
n.p = f
n.r = f
n.u = c
f.y = m
f.u = m
f.o = c
f.v = j
f.t = j
c.q = f
h.w = l
h.p = f
h.r = f
h.u = c
assert c.q.y.s.t.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: F = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: D = None
        self.q: A = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.o: F = None
        self.v: C = None
        self.t: C = None
        self.txt = txt

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

m = A("m")
l = B("l")
j = C("j")
n = D("n")
f = E("f")
c = F("c")
h = D("h")

m.s = j
m.x = c
m.r = f
l.o = c
l.r = n
j.r = m
j.q = m
j.o = h
j.t = h
n.w = l
n.p = f
n.r = f
n.u = c
f.y = m
f.u = m
f.o = c
f.v = j
f.t = j
c.q = f
h.w = l
h.p = f
h.r = f
h.u = c
assert c.q.y.s.t.u.q.txt == "f"